home *** CD-ROM | disk | FTP | other *** search
- CPU_TIME(3I) Last changed: 4-13-99
-
-
- NNAAMMEE
- CCPPUU__TTIIMMEE - Returns the processor time
-
- SSYYNNOOPPSSIISS
- CCPPUU__TTIIMMEE (([TTIIMMEE==]_t_i_m_e))
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, and IRIX systems
-
- CF90, MIPSpro 7 Fortran 90
-
- SSTTAANNDDAARRDDSS
- Fortran
-
- DDEESSCCRRIIPPTTIIOONN
- The CCPPUU__TTIIMMEE intrinsic subroutine returns the user time if successful.
- This intrinsic subroutine accepts the following argument:
-
- _t_i_m_e Must be a scalar and of type real. It is an output
- argument. The type of the argument is not restricted to any
- particular kind type.
-
- The name of this intrinsic cannot be passed as an argument. The time
- returned by this intrinsic subroutine is user time on all systems.
-
- On UNICOS and UNICOS/mk systems, a call to CCPPUU__TTIIMMEE must be done once
- and before the first timing loop to initialize the time structure.
- CCPPUU__TTIIMMEE includes time accumulated by all processors in a multitasking
- program.
-
- RREETTUURRNN VVAALLUUEESS
- CCPPUU__TTIIMMEE returns --11..00 if the time cannot be returned.
-
- EEXXAAMMPPLLEESS
- The following program uses the CCPPUU__TTIIMMEE intrinsic subroutine and was
- run on an IRIX system:
-
- PROGRAM CPUTIMETEST
- REAL RTIME(2)
- CHARACTER(LEN=400) :: EXPRIGHT2
- CHARACTER(LEN=800) :: EXPRIGHT
- INTEGER :: J
- CALL CPU_TIME(RTIME(1))
- IF (RTIME(1) .EQ. -1.0) THEN
- PRINT *,'CPU_TIME NOT WORKING, QUIT'
- PRINT *,'RTIME(1) =',RTIME(1)
- STOP 'UNSUCCESSFUL'
- ENDIF
- CALL CPU_TIME(RTIME(1))
- DO J = 1, 400
- EXPRIGHT2(J:J) = " "
- ENDDO
- CALL CPU_TIME(RTIME(2))
- PRINT *,'ELAPSED CPUTIME TIME=',RTIME(2) - RTIME(1)
-
- CALL CPU_TIME(RTIME(1))
- DO J = 1, 800
- EXPRIGHT(J:J) = " "
- ENDDO
- CALL CPU_TIME(RTIME(2))
- PRINT *,'ELAPSED CPUTIME TIME=',RTIME(2) - RTIME(1)
- end
-
- This program generated the following output:
-
- ELAPSED CPUTIME TIME= 1.109996811E-4
- ELAPSED CPUTIME TIME= 2.029994503E-4
-
- SSEEEE AALLSSOO
- _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
- man page.
-